/* 
 * File:   BMPHeaderTest.cpp
 * Author: max
 *
 * Created on Oct 5, 2012, 12:59:30 AM
 */

#include <stdlib.h>
#include <iostream>
#include <fstream>

#include "BMPHeader.h"

using namespace std;
using namespace TP::Grafica::Renderizado;

/*
 * Simple C++ Test Suite
 */

void test1() {
    std::cout << "BMPHeaderTest test 1" << std::endl;
}

void test2() {
    std::cout << "BMPHeaderTest test 2" << std::endl;
    
    ifstream input ("/home/Max/facultad/75.12.TallerProg/TPs/TP3/Fuentes/TP3/R_180.bmp", ifstream::binary);
    
    if (input.is_open())
    {
        BMPHeader header;
        input >> header;
        
        if (!(header.GetBmpWidth() == 35 && header.GetBmpHeight() == 19))
            std::cout << "%TEST_FAILED% time=0 testname=test2 (BMPHeaderTest) message=La lectura del header arroja como resultado un alto y ancho no correspondiente con la imagen de prueba (Ancho:35,Alto:19)." << std::endl;
    }
    else
        std::cout << "%TEST_FAILED% time=0 testname=test2 (BMPHeaderTest) message=No se pudo abrir el archivo bmp." << std::endl;
}

int main(int argc, char** argv) {
    std::cout << "%SUITE_STARTING% BMPHeaderTest" << std::endl;
    std::cout << "%SUITE_STARTED%" << std::endl;

    std::cout << "%TEST_STARTED% test1 (BMPHeaderTest)" << std::endl;
    test1();
    std::cout << "%TEST_FINISHED% time=0 test1 (BMPHeaderTest)" << std::endl;

    std::cout << "%TEST_STARTED% test2 (BMPHeaderTest)\n" << std::endl;
    test2();
    std::cout << "%TEST_FINISHED% time=0 test2 (BMPHeaderTest)" << std::endl;

    std::cout << "%SUITE_FINISHED% time=0" << std::endl;

    return (EXIT_SUCCESS);
}

